<script>
	import {
		init
	} from "@/trnall";
	export default {
		onLaunch: function(options) {
			console.log('App Launch')
			init(options);
			this.$store.dispatch('getShopCategory')
		},
		onShow: function() {
			console.log('App Show')
			uni.getSetting({
				success(res) {
					console.log('getSetting', res.authSetting)
					let authSetting = res.authSetting;
					// let first = parseInt(uni.getStorageSync('first_login'))
					if (authSetting.hasOwnProperty('scope.userInfo') == false || authSetting[
							'scope.userInfo'] == false || !uni.getStorageSync('first_login')) {
						console.log('授权失败')
						uni.setStorageSync('authUserInfo', false)
					} else {
						uni.setStorageSync('authUserInfo', true)
					}
					uni.setStorageSync('first_login', 1)
				}
			})
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	page {
		background: #eee;
	}

	button {
		display: flex;
		align-items: center;
		justify-content: center;
		border: none;
		background: #ff9000;
		border-radius: 5px;
		color: #fff;
		margin: 0;
		padding: 0;
	}

	button::after {
		border: none;
	}

	/* button {
		position: relative;
		display: block;
		margin-left: auto;
		margin-right: auto;
		padding-left: 0px;
		padding-right: 0px;
		box-sizing: border-box;
		text-align: center;
		text-decoration: none;
		line-height: 1.35;
		-webkit-tap-highlight-color: transparent;
		overflow: hidden;
		color: #000000;
		background-color: #fff;
		width: 100%;
		height: 100%;
	} */
</style>
